package com.dragon.sdgp.controller;

import com.dragon.sdgp.common.R;
import com.dragon.sdgp.entity.SysUser;
import com.dragon.sdgp.service.SysUserService;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @AUTHOR : Dragon_Yang
 * @File : SysUserController
 * @DESCRIPTION :
 * @DATE : 2023/3/12 16:37
 */
@RestController
@RequestMapping("/api/SysUser")
public class SysUserController {

    @Autowired
    private SysUserService sysUserService;

    @PostMapping("/register")
    public R sysUserRegister(@Param ("code") String code,
                             @RequestBody SysUser sysUser){
        return sysUserService.sysUserRegister(code, sysUser);
    }

    @PostMapping("/login")
    public R sysUserLogin(@RequestBody SysUser sysUser){
        return sysUserService.sysUserLogin(sysUser);
    }
}
